//
//  DataRequest.h
//  MMairs
//
//  Created by dongguozheng on 2017/2/22.
//  Copyright © 2017年 dongguozheng. All rights reserved.
//

#import <Foundation/Foundation.h>

//判断当前网络情况
#import "Reachability.h"

//block异步回调
typedef void(^SuccessBlock)(id  response);

typedef void(^failBlock)(NSError *error);

@interface DataRequest : NSObject

//声明单例
+(instancetype)shareAFNetWorking;

//判断当前是否有网络链接
+(BOOL)animalNetWorkConnection;

//上传文件，图片等
-(void)UploadImageWithPOST:(NSString *)POST WithParameters:(NSDictionary *)dic withAuthorization:(NSString *)authorization WithUploadImage:(UIImage *)image successBlock:(SuccessBlock)success FailBlock:(failBlock)fail;

//GET请求方法封装:
-(void)GETRequestWithUrl:(NSString* )urlString paramaters:(NSDictionary* )paramaters WithAuthorization:(NSString *)authorization successBlock:(SuccessBlock)success FailBlock:(failBlock)fail;

//POST请求方法封装:
-(void)POSTRequestWithUrl:(NSString* )urlString paramaters:(NSMutableDictionary* )paramaters WithAuthorization:(NSString *)authorization successBlock:(SuccessBlock)success FailBlock:(failBlock)fail;
@end
